/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface ShopSalesPackage extends BasicModel<ShopSalesPackage> {
  title?: string; // 标题
  beginDate?: string; // 生效日期
  endDate?: string; // 失效日期
  fbStatus?: string; // 发布状态
}

export const shopSalesPackageList = (params?: ShopSalesPackage | any) =>
  defHttp.get<ShopSalesPackage>({ url: adminPath + '/shop/sales/shopSalesPackage/list', params });

export const shopSalesPackageListData = (params?: ShopSalesPackage | any) =>
  defHttp.post<Page<ShopSalesPackage>>({ url: adminPath + '/shop/sales/shopSalesPackage/listData', params });

export const shopSalesPackageForm = (params?: ShopSalesPackage | any) =>
  defHttp.get<ShopSalesPackage>({ url: adminPath + '/shop/sales/shopSalesPackage/form', params });

export const shopSalesPackageSalesForm = (params?: ShopSalesPackage | any) =>
  defHttp.get<ShopSalesPackage>({ url: adminPath + '/shop/sales/shopSalesPackage/salesForm', params });
  

export const shopSalesPackageSave = (params?: any, data?: ShopSalesPackage | any) =>
  defHttp.postJson<ShopSalesPackage>({ url: adminPath + '/shop/sales/shopSalesPackage/save', params, data });

export const shopSalesPackageDelete = (params?: ShopSalesPackage | any) =>
  defHttp.get<ShopSalesPackage>({ url: adminPath + '/shop/sales/shopSalesPackage/delete', params });


  export const shopSalesPackageSavePacks = (params?: any, data?: ShopSalesPackage | any) =>
  defHttp.postJson<ShopSalesPackage>({ url: adminPath + '//shop/sales/shopSalesPackage/savePacks', params, data });


  export const shopSalesPackageUpdateFbStatus = (params?: ShopSalesPackage | any) =>
  defHttp.post<ShopSalesPackage>({ url: adminPath + '/shop/sales/shopSalesPackage/updateFbStatus', params });

  export const shopSalesPackageTreeData = (params?: ShopSalesPackage | any) =>
    defHttp.post<ShopSalesPackage>({ url: adminPath + '/shop/sales/shopSalesPackage/treeData', params });

  export const shopSalesPackageSelPackage = (params?: ShopSalesPackage | any) =>
    defHttp.postJson<ShopSalesPackage>({ url: adminPath + '/shop/sales/shopSalesPackage/selPackage', params });